OTTransferProviderOwnership
Transfers a provider's ownership to a new client.C INTERFACE
ProviderRef OTTransferProviderOwnership ( ProviderRef ref, OTClient prevOwner, OSStatus* errPtr);C++ INTERFACE
ProviderRef TProvider::OTTransferProviderOwnership ( OTClient prevOwner, OSStatus* errPtr);PARAMETERS
ref
- The provider reference for the provider to be transferred.
prevOwner
- The client ID of the previous owner.
errPtr
- A pointer to a result code.
DESCRIPTION
The OTTransferProviderOwnership function transfers the ownership of the provider indicated by theref
parameter to the current Open Transport client. The previous owner must provide the owner-to-be with its client ID, obtained by using theOTWhoAmI
function; this is then used by the owner-to-be in theprevOwner
parameter. Open Transport allocates a new provider reference and returns the new reference as the function result. The old provider reference is then obsolete and should not be used.SPECIAL CONSIDERATIONS
When installing a notifier into a provider, Open Transport assumes that theOTNotifyProcPtr
pointer is in the same architecture as the call is being made. After transferring ownership, remove any already installed notifiers and install your own, unless your architecture is such that a cross-architecture notifier is what you want.
- WARNING
- As long as the client that created the provider remains loaded and is in the same architecture (that is, the PowerPC as opposed to the 68000-family Macintosh CPU environments) as the client using the provider, no damage is done by not making this call. However, if the provider was created under a different architecture than the current client using the provider, attempting to close the provider causes a crash. If you do not use the
OTTransferProviderOwnership
function, it is vital that the provider be closed under the same architecture that opened the provider.![]()
SEE ALSO
To get a client ID, call theOTWhoAmI
function (page 2-25).